﻿using System;
using System.Collections.Generic;

namespace Pixels.Logic.Rules
{
    class Research : LogicRule {

        internal override void execute() {
            if (World.CurrentResearch != Technologies.none) {
                var tech = GlobalConsts.getTechnology(World.CurrentResearch);
                tech.advanceResearch( World.Colony.totalResearch);
                if (tech.researched) {
                    World.Logic.injectEvent(new GameplayEvents.TechResearchedEvent(tech.ID));
                    World.CurrentResearch = Technologies.none;
                }
                
            }
            
        }

    }
}
